<template>
  <div class="getMore"></div>
  <div class="home">
    <van-search
      class="search"
      v-model="value"
      placeholder="请输入搜索关键词"
    />
    <div class="top">
      <van-swipe
        class="my-swipe"
        :autoplay="3000"
        indicator-color="white"
      >
        <van-swipe-item
          v-for="item in lunbolist"
          :key="item.goodsId"
        >
          <img
            v-lazy="item.goodsImg"
            alt=""
          />
        </van-swipe-item>
      </van-swipe>
    </div>
    <van-grid :column-num="4">
      <van-grid-item
        v-for="value in 8"
        :key="value"
        icon="question-o"
        text="装修服务"
      />
    </van-grid>

    <van-panel title="优惠活动">
      <div>
        <van-tabs
          v-model="active"
          animated
          title-active-color="#ED222D"
        >
          <van-tab title="限时秒杀">
            <van-panel
              title="限时秒杀"
              status="更多》"
            >
              <div>
                <van-grid
                  class="limit_time"
                  :column-num="3"
                >
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥1299"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2099"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2299"
                    to="/home/limitbuy"
                  />
                </van-grid>
              </div>
            </van-panel>
          </van-tab>
          <van-tab title="限量团购">
            <van-panel
              title="限时秒杀"
              status="更多》"
            >
              <div>
                <van-grid
                  class="limit_time"
                  :column-num="3"
                >
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥1299"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2099"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2299"
                    to="/home/limitbuy"
                  />
                </van-grid>
              </div>
            </van-panel>
          </van-tab>
          <van-tab title="当季流行">
            <van-panel
              title="限时秒杀"
              status="更多》"
            >
              <div>
                <van-grid
                  class="limit_time"
                  :column-num="3"
                >
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥1299"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2099"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2299"
                    to="/home/limitbuy"
                  />
                </van-grid>
              </div>
            </van-panel>
          </van-tab>
          <van-tab title="精选特惠">
            <van-panel
              title="限时秒杀"
              status="更多》"
            >
              <div>
                <van-grid
                  class="limit_time"
                  :column-num="3"
                >
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥1299"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2099"
                    to="/home/limitbuy"
                  />
                  <van-grid-item
                    icon="https://i8.mifile.cn/v1/a1/7dc38112-bbf4-f3fa-db39-5f4674f9d0d4!720x792.webp"
                    text="￥2299"
                    to="/home/limitbuy"
                  />
                </van-grid>
              </div>
            </van-panel>
          </van-tab>
        </van-tabs>
      </div>
    </van-panel>

    <div class="deco-price">
      <div class="deco-title">
        <van-icon name="balance-list-o" />
        <span class="t1">装修报价|</span>
        <span class="t2">根据房屋信息快速获取报价</span>
      </div>
      <div class="deco-content">
        <div>房屋户型：<span>普通住宅 两室一厅</span>></div>
        <div>
          房屋面积：<input
            type="text"
            placeholder="请输入您的房屋面积"
          />m²
        </div>
        <div>
          预期价格：<input
            type="text"
            placeholder="请输入您的预期价格"
          />万
        </div>
      </div>
      <van-button
        plain
        hairline
        type="primary"
        >获取报价</van-button
      >
    </div>

    <van-panel
      class="case-title"
      title="装修案例"
      status="查看全部》"
    >
      <div class="deco-case">
        <dl class="case">
          <dt>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </dt>
          <dd>城厢小洋楼460平米....</dd>
          <dd class="city">
            <span>长沙市</span>
            <span><van-icon name="eye-o" />14523</span>
          </dd>
        </dl>
        <dl class="case">
          <dt>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </dt>
          <dd>城厢小洋楼460平米....</dd>
          <dd class="city">
            <span>长沙市</span>
            <span><van-icon name="eye-o" />14523</span>
          </dd>
        </dl>
      </div>
    </van-panel>

    <van-panel
      class="case-title"
      title="设计师"
      status="查看全部》"
    >
      <div class="deco-case deco-design">
        <dl class="case caseperson">
          <dt>
            <img
              src="../assets/max2.webp"
              alt=""
            />
          </dt>
          <dd>刘晓静</dd>
          <dd class="city">集团别墅装设计师</dd>
          <dd class="city">
            <span>从业16年</span>
            <span>作品52套</span>
          </dd>
        </dl>
        <dl class="case caseperson">
          <dt>
            <img
              src="../assets/max2.webp"
              alt=""
            />
          </dt>
          <dd>刘晓静</dd>
          <dd class="city">集团别墅装设计师</dd>
          <dd class="city">
            <span>从业16年</span>
            <span>作品52套</span>
          </dd>
        </dl>
      </div>
    </van-panel>

    <van-panel
      class="case-title"
      title="装修方案"
      status="查看全部》"
    >
      <div class="deco-case deco-methods">
        <dl class="case">
          <dt>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </dt>
          <dd>雨花区独栋别墅轻奢风格大平层装修方案</dd>
          <dd class="city">
            <span>轻奢</span>
            <span>大平层&nbsp;600m²</span>
          </dd>
        </dl>
        <dl class="case">
          <dt>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </dt>
          <dd>雨花区独栋别墅轻奢风格大平层装修方案</dd>
          <dd class="city">
            <span>轻奢</span>
            <span>大平层&nbsp;600m²</span>
          </dd>
        </dl>
        <dl class="case">
          <dt>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </dt>
          <dd>雨花区独栋别墅轻奢风格大平层装修方案</dd>
          <dd class="city">
            <span>轻奢</span>
            <span>大平层&nbsp;600m²</span>
          </dd>
        </dl>
      </div>
    </van-panel>

    <van-panel
      class="case-title"
      title="装修指南"
      status="查看全部》"
    >
      <div class="deco-news">
        <van-card
          title="面积小的独栋小居室应该怎么搞装修才划算?"
          thumb="../assets/hongmi5.webp"
        >
          <template #price>
            <div class="eye-star">
              <div><van-icon name="eye-o" />123</div>
              <div><van-icon name="star-o" />65</div>
            </div>
          </template>
          <template #thumb>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </template>
        </van-card>
        <van-card title="面积小的独栋小居室应该怎么搞装修才划算?">
          <template #price>
            <div class="eye-star">
              <div><van-icon name="eye-o" />123</div>
              <div><van-icon name="star-o" />65</div>
            </div>
          </template>
          <template #thumb>
            <img
              src="../assets/hongmi5.webp"
              alt=""
            />
          </template>
        </van-card>
      </div>
    </van-panel>
  </div>
>>>>>>> 56c488de3eb3260e1bcd1a546c828074025159d3:src/views/HomeView.vue
</template>
<script>
// 第六步：页面引入刚才定义好的接口
import { getGoodsList } from '@/api/todos';
import { goodsDetailList } from '@/api/todos';
export default {
  data() {
    return {
      lunbolist: [],
      value: '装修/设计',
      active: 0,
    };
  },
  created() {
    // 第七步：调用
    this.getGoodsList();
    goodsDetailList().then((res) => {
      console.log(res);
    });
  },
  methods: {
    async getGoodsList() {
      const res = await getGoodsList();
      this.lunbolist = res.data;
      console.log(res.data);
    },
  },
};
</script>
<style lang="scss">
.home {
  margin-bottom: 100px;
  padding: 0;
  .my-swipe {
    img {
      width: 100%;
      height: 180%;
    }
  }
  .top {
    background-color: #eaeaea;
    padding: 0 14px;
    .my-swipe {
      height: 137px;
      width: 343px;
    }
  }
  .van-grid-item__icon {
    font-size: 44px;
  }
  .van-grid {
    margin: 10px;
    border: 1px solid #eee;
  }
  .van-search {
    background-color: #eaeaea;
    padding: 10px 12px 30px;
  }
  .van-cell__title {
    span {
      font-size: 16px;
      font-family: PingFangSC-regular;
    }
  }
  .van-tab {
    color: #000c17;
  }
  .limit_time {
    .van-grid-item {
      width: 30%;
    }
    .van-grid-item__icon {
      img {
        width: 88px;
        height: 120px;
      }
    }
    .van-grid-item__text {
      font-size: 14px;
      color: #101010;
      font-style: italic;
      font-weight: 600;
    }
    .van-grid-item__content {
      padding: 0 8px;
    }
  }
  .deco-price {
    background-color: #fff;
    padding: 0 20px;
    width: 310px;
    height: 320px;
    margin: 20px auto 20px;
    border: 1px solid #eee;
    .deco-title {
      .van-icon {
        font-size: 40px;
      }
      .t1 {
        font-size: 20px;
        color: #101010;
        margin: 0 8px;
      }
      .t2 {
        font-size: 14px;
        color: #b9b1b1;
      }
    }
    .deco-content {
      div {
        font-size: 18px;
        padding: 20px 0;
        border-bottom: 1px solid #ccc;
        input {
          width: 190px;
          border: 0;
          font-size: 14px;
        }
        span {
          display: inline-block;
          width: 190px;
        }
      }
    }
    .van-button--plain {
      color: red;
      border: 1px solid red;
      width: 100%;
      margin-top: 20px;
      font-size: 16px;
    }
  }
  .case-title {
    padding: 0 10px;
    .van-panel__header-value {
      color: #827e7e;
    }
    .deco-case {
      display: flex;
      align-items: center;
      justify-content: space-between;
      .case {
        border: 1px solid #eee;
        width: 168px;
        height: 189px;
        img {
          margin: 10px 0px 0px 8px;
          width: 151px;
          height: 99px;
        }
        dd {
          padding: 0 10px;
          margin-left: 0;
          font-size: 14px;
          color: #101010;
          margin-top: 20px;
        }
        .city {
          margin-top: 10px;
          color: #827e7e;
          font-size: 14px;
          display: flex;
          justify-content: space-between;
        }
      }
      .caseperson {
        border: 1px solid #eee;
        height: 220px;
        img {
          width: 117px;
          height: 125px;
          margin-left: 25px;
        }
        dd {
          padding: 0 10px;
          margin-left: 0;
          font-size: 14px;
          color: #101010;
          margin: 10px 0;
          font-size: 16px;
          font-weight: 600;
        }
        .city {
          margin: 0px;
          font-size: 12px;
          font-weight: normal;
        }
      }
    }
    .deco-methods {
      overflow: hidden;
      .case {
        margin: 0 10px;
        border: 0;
        width: 126px;
        height: 220px;
        img {
          height: 116px;
          width: 116px;
          margin-left: 4px;
        }
        dd {
          font-size: 14px;
          margin: 10px 0;
          width: 126px;
          padding: 0;
          font-weight: 600;
        }
        .city {
          margin-top: 4px;
          font-size: 12px;
        }
      }
    }
  }
  .deco-news {
    .van-card {
      margin-top: 0;
      border: 1px solid #eee;
      background-color: #fff;
      .van-card__title {
        font-size: 16px;
        font-weight: 600;
        max-height: 60px;
        line-height: 26px;
      }
      img {
        width: 85px;
        height: 59px;
        margin-top: 10px;
      }
      .eye-star {
        display: flex;
        font-size: 18px;
        div {
          margin-left: 20px;
          font-size: 16px;
        }
      }
    }
  }
}
</style>
